#include <stdlib.h>

#include "memory.h"
#include "Triple.h"
#include "..\Mobile.h"

void *malloc__a16(unsigned int length, void **base_ptr)
{
	void *m = malloc(length + 16);
	if (m != NULL)
	{
		*base_ptr = m;
		return (void*)(((unsigned long)m + 15) & (unsigned long)(~15));
	}
	else
	{
		return NULL;
	}
}

void Triple__memlayout_test()
{
	Triple t;
	unsigned long offset = (unsigned long)&(t[0]) - (unsigned long)&t;
	if (offset > 0)
	{
		cout << "Triple class has invalid memlayout (coord offset = " << offset << ")" << endl;
	}
}
